'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数

	let {length,page} = event
	const db = uniCloud.database()
	let data = await db.collection("leave").aggregate().sort({ _id:-1}).skip(page).limit(length).end()
	let count = await db.collection("leave").count()
	return  {
	  data,
	  count
	}
	//返回数据给客户端

};
